<template>
  <div>格式化时间</div>
  <div>当前时间是：{{ fotmat(timer) }}</div>

  <button @click="fn(-1)">count--</button>
  <span>{{ count }}</span>
  <button @click="fn(1)">count++</button>
</template>

<script setup>
import { ref, onMounted, computed } from "vue";
import { fotmat } from "../utils/index";
import useCounter from "@/hooks/useCounter";

const timer = ref(0);
onMounted(() => {
  timer.value = 1731977738291;
});

// const count = ref(10);
// const fn = (n) => {
//   count.value += n;
// };

const [count, fn] = useCounter(10);
</script>
